<?

$thisMdl        = "STK-BAL";

$entryBoxStyle  = " ";

$GHtml       = new CGHtml;
$GJs         = new CGJavascript;
$Misc        = new Misc;
$CLFetchers  = new CLFetchers;

$SourceDb   = new Composer;
$SourceDb   = $SourceDb->init("db");

$SourceDb->add("srcDbHdr",        "STK_BAL_HDR");
$SourceDb->add("srcDbDtl",        "STK_BAL_DTL");
$SourceDb->add("srcDbWarehouse",  "MST_WAREHOUSE");

$optPrivs = "";
if($UID->getPrivs( $thisMdl, _VIEW_RIGHTS) > 0){

	$optPrivs .=	"  <td> ".$GHtml->formInputButton("<font size='5'>View</font>", // The label
          							                           "view",                       // var Name
          							                           "View",                       // var value
          							                           $entryBoxStyle)." </td>\n";   // var properties
}

/**
* connect to db to retrieve data with system period as the range
*
*/
$Db = new oracleDb;
$Db->init($_SESSION["ORCL"],
           $_SESSION["OPASS"],
           $_SESSION["SID"],
           _NO_COMMENT);

if ($Db->connect()) {

  $srcDbHdr = "STK_BAL_HDR";

  $propWarehouse = $GJs->jsOnFocus("GMisc.setYellow2(this);
                                    Ajax.whs(this);").

                   $GJs->jsOnBlur ("GMisc.setWhite2(this);");

  $lstWarehouse = $Misc->retArray($_POST["radioview"]);

  //lets init the first table
  echo  "<link rel=\"stylesheet\" type=\"text/css\" href=\"myMenu.css\"/>\n".

        /**
        * Global module js
        *
        */
        "<SCRIPT LANGUAGE='JavaScript' SRC='/ecs/javascript/GMisc.js'></SCRIPT> \n".

        /**
        * This module js
        *
        */
  		  "<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"/ecs/tocmenu_62/javascript/misc.js\"></SCRIPT> \n".
  		  "<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"/ecs/tocmenu_62/javascript/ajax.js\"></SCRIPT> \n".

  			"<br/><br/><br/><br/><br/>\n".
  			"<table border='1'>\n".
  			"<form action=tocmenu_62/viewdboredit.php method=post>\n".
  			"<table border='1' class='dedeq' align='center'>\n".
        "<tr>\n".

        "<td align='center'> ".$GHtml->formDropDown("radioview",
                                                    $_POST["radioview"],
                                                    $lstWarehouse,
                                                    $propWarehouse)." </td>\n".

  			"</tr>\n".
        $optPrivs.
        "</tr>\n".
  			"</table>\n".
  			"<br/>\n".
				"</form>\n";

	$Db->dc();
}else{

  $Misc->usrDie("DB connection failed");
}

session_commit();

?>